import cython
from numpy cimport ndarray
from v3dsolver.vector cimport Vec

cdef extern from "math.h":
    double tanh(double)

@cython.locals(result=double,i=int,coeff=double)
cdef public double eval_legendre(list coeffs,double x)

cdef class FluidElem:
    cdef public Vec pos
    cdef public Vec vel
    cdef public int cause_or_effect

    cpdef bint is_cause(self)
    cpdef bint is_effect(self)
    cdef move(self,double time_interval)

cdef class FreeStream:
    cdef public Vec freestream_val

    cpdef Vec get_vel(self,FluidElem fluid_elem)

cdef class VortexBlob(FluidElem):
    cdef public double rad
    cdef public Vec vor
    cdef public list parentid
    cdef public list stretchpts

cdef class Saffman(VortexBlob):
    @cython.locals(vel=Vec, pi=double,rvec=Vec,r=double,sigma=double,
                   f=double,K_delta=Vec)
    cpdef Vec get_vel(self,FluidElem fluid_elem)

cdef class PseudoParticle(Saffman):
    cdef public list P_l
    cdef public list elems
    
    @cython.locals(elem=Saffman,cell_center=Vec,cell_radius=double,
                   center2elem_length=double,factor1=double,l=int,
                   legendre=double,factor=double,elem_vor=Vec,vor=Vec,
                   center2pseudo=Vec,center2elem=Vec,cos_angle=double)
    cdef Vec get_vor(self, cell)

cdef class BoundaryBlob(Saffman):
    cpdef public parent_panel
    
cdef class ReleaseBlob(Saffman):
    cpdef public copy_blob
    cpdef public parent_panel
    
cdef class ControlPt(Saffman):
    cpdef public parent_panel
